<?php

namespace app\interior\controller;

use app\health\model\tracking\HealthTrackingUrlCode;

class Sync extends BaseInterior
{
    /**
     * Undocumented function
     * @Author 张旭鹏
     * @DateTime 2023-07-10
     */
    public function tracking_url_code()
    {
        $type = request()->param('type');
        if ($type == 8) {
            $row = HealthTrackingUrlCode::where('code', 'sms_template_x')->where('day', date('Y-m-d'))->find();
            if (!$row) {
                $row = HealthTrackingUrlCode::create(['code' => 'sms_template_x', 'put_in' => '1', 'day' => date('Y-m-d')]);
            } else {
                $row->setInc('put_in');
            }
        }
        return json(['code' => 1, 'msg' => '更新成功']);
    }
}
